//import java.util.Scanner;
//public class Test {
//        public static void main(String[] args) {
//            Scanner sc = new Scanner(System.in);
//            int count = 3;
//            while (count != 0) {
//                System.out.println("请输入密码：");
//                String input = sc.nextLine();
//                if (input.equals("20250228")) {
//                    System.out.println("登陆成功");
//                    break;
//                } else {
//                    count--;                      //模拟登陆
//                }
//            }
//            sc.close();
//            if (count == 0) {
//                System.out.println("退出程序");
//            }
//        }
//    }

import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n= sc.nextInt();
        long sum=0;
        for (int i = 1; i <=n ; i++) {
            long ret=1;
            for (int j = 1; j <=i ; j++) {
                ret*=j;
            }
            sum+=ret;                            //求阶乘和
        }
        System.out.println(sum);
        sc.close();
    }
}
import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(fib(n));
    }

    public static int fib(int n) {
        if (n == 1 || n == 2) {
            return 1;
        }
        int f1 = 1;
        int f2 = 1;
        int f3 = 1;
        for (int i = 3; i <= n; i++) {
            f3 = f1 + f2;
            f1 = f2;                    //求斐波那契数列的第n项。(迭代实现)
            f2 = f3;
        }
        return f3;
    }
}
public class Test {
    public static int max(int num1, int num2) {
        return num1 > num2? num1 : num2;
    }
    public static double max(double num1, double num2, double num3) {
        double max = num1;
        if (num2 > max) {
            max = num2;
        }
        if (num3 > max) {
            max = num3;
        }
        return max;
    }                                            //在同一个类中定义多个方法：要求不仅可以求2个整数的最大值，还可以求3个小数的最大值

    public static void main(String[] args) {
        int intResult = max(10, 20);
        System.out.println("两个整数中的最大值是: " + intResult);

        double doubleResult = max(1.5, 2.5, 3.5);
        System.out.println("三个小数中的最大值是: " + doubleResult);
    }
}

